<?php

namespace App\Http\Controllers;

class TestController
{
    public function index()
    {
        var_dump(getenv(APP_ENV));exit;
        return 'Hello World, How are you';
    }

    public function test()
    {
        // $host = "mysql.rdsm40go2t3s6i5.rds.gz.baidubce.com";
        // $database = 'zijinge';
        // $username = "zhurongpeng";
        // $password = "oA9cr0KB2ixY";

        // $host = "ftp6138669.host566.zhujiwu.me";
        // $database = 'zijinge';
        // $username = 'zjwdb_6138669';
        // $password = 'ah8$zF=cMv%Tf/+';

        $mysqli = new \mysqli("localhost", "zhurongpeng", "develop", "zijinge");
        // $mysqli = new \mysqli(getenv('DB_HOST'), getenv('DB_USERNAME'), getenv('DB_PASSWORD'), getenv('DB_DATABASE'));
        //
        if(!$mysqli)  {
            echo"database error";
        }else{
            echo"php env successful";
        }
        //
        // $mysqli->close();

        // $pdo = new \PDO("mysql:host=$host;dbname=$database", $username, $password);
        // if (!$pdo) {
        //       die("could not connect to the database.\n" . \mysqli_error($pdo));
        // }
    }
}
